Ext.define('Admin.view.overtimeapprove.OvertimeApproveFrom', {
    extend: 'Ext.form.Panel',
    id: 'overtimeApproveFrom',
    alias: 'widget.overtimeApproveFrom',
    requires: [
        'Ext.layout.container.Anchor',
        'Ext.layout.container.Column',
        'Ext.button.Button',
        'Ext.form.field.Text',
        'Ext.form.field.File',
        'Ext.form.field.HtmlEditor',
        'Ext.form.field.TextArea',
        'Ext.form.field.Time',
        'Ext.form.field.ComboBox',
        'Ext.form.field.Date',
        'Ext.form.field.Radio',
        'Ext.form.field.Hidden'
    ],
    //viewModel: {type: 'emailcompose'},
    //cls: 'email-compose',
    controller: 'overtimeApproveViewController',

    scrollable: true,

    bodyStyle: 'padding:5px 5px 0',
    width: "100%",
    fieldDefaults: {
        labelAlign: 'top',
        msgTarget: 'qtip',
        allowBlank: false,
        blankText: '该项不能为空'
    },

    items: [{
        xtype: 'fieldcontainer',
        fieldLabel: '是否同意本次申请',
        defaultType: 'radiofield',
        id: 'isPass',
        defaults: {
            flex: 1
        },
        layout: 'hbox',
        items: [
            {
                boxLabel: '同意',
                name: 'isPass',
                inputValue: true,
                checked: true,
                listeners: {
                    focus: function () {
                        Ext.getCmp('rejectReason').setDisabled(true);
                    }
                }
            }, {
                boxLabel: '不同意',
                name: 'isPass',
                inputValue: false,
                listeners: {
                    focus: function () {
                        Ext.getCmp('rejectReason').setDisabled(false);
                    }
                }
            }
        ]
    }, {
        id: 'rejectReason',
        xtype: 'textarea',
        name: 'rejectReason',
        fieldLabel: '驳回理由',
        allowBlank: false,
        disabled: true,
        anchor: '100%'
    }, {
        xtype: 'hidden',
        name: 'taskId'
    }, {
        xtype: 'hidden',
        name: 'id'
    }, {
        xtype: 'hidden',
        name: 'taskDefinitionKey'
    }, {
        xtype: 'hidden',
        name: 'processInstanceId'
    }],
    bbar: {
        items: ['->', {
            xtype: 'button',
            //ui: 'soft-red',
            text: '提交',
            handler: 'onClickOvertimeApproveFormSubmit'
        }, {
                xtype: 'button',
                //ui: 'gray',
                text: '取消',
                handler: 'closeWindow'
            }]
    }
});